#ifndef __SPIKE_H
#define __SPIKE_H

#include "trap.h"
#include"animation.h"

extern Atlas atlas_wheel_on;;

extern Camera main_camera;

class Spike :public Trap
{
public:
	Spike()
	{
		size.x =38*2 , size.y =38*2 ;

		damage = 10;

		animation_spike.set_atlas(&atlas_wheel_on);
		animation_spike.set_interval(50);
	}
	~Spike() = default;

	void on_collide()
	{
		Trap::on_collide();

		main_camera.shake(20, 500);


	}

	void on_update(int delta)
	{
		animation_spike.on_update(delta);
	}

	void on_draw(const Camera& camera) const
	{
		animation_spike.on_draw(camera,(int)position.x,(int)position.y);
		Trap::on_draw(camera);
	}
private:
	Animation animation_spike;
};

#endif

